//
//  BQCustomButton.m
//  BeeQuick
//
//  Created by Asun on 2017/7/10.
//  Copyright © 2017年 BecomeRich. All rights reserved.
//

#import "BQCustomButton.h"

@implementation BQCustomButton

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame] ) {
        [self layoutSubviews];
    }
    return self;

}

- (void)layoutSubviews{

    [super layoutSubviews];

    CGRect imageRect = self.imageView.frame;
    imageRect.size = CGSizeMake(15, 15);
    imageRect.origin.x = (self.frame.size.width ) ;
    imageRect.origin.y = (self.frame.size.height - 20)/2.0f;
    CGRect titleRect = self.titleLabel.frame;
    titleRect.origin.x = (self.frame.size.width - imageRect.size.width- titleRect.size.width);
    titleRect.origin.y = (self.frame.size.height - titleRect.size.height)/2.0f;
    self.imageView.frame = imageRect;    self.titleLabel.frame = titleRect;

}
@end
